package com.android.jump;

import com.android.jump.jumper.DrawableObject;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;

public class Cloud extends DrawableObject
{
	Animation mFallAnimation = null;
	Animation mDeposeAnimation = null;
	Animation mCurAnimation = null;
	Cloud(Bitmap nBitmap,Animation nFallAnimation,Animation nDeposeAnimation)
	{
	    super(nBitmap);
	    
	    mFallAnimation = nFallAnimation;
	    mDeposeAnimation = nDeposeAnimation;
	    
	    mCurAnimation = mFallAnimation;
	    setArea(getPositionX() / 2, getPositionY() / 2, 25);
	}
	public void update(int nChange)
	{
	    setPosition(getPositionX(), getPositionY() + nChange);
	}
	//public void Set
	public boolean isOutofDate()
	{
		return getPositionY() >= 460;
	}
	public void doDraw(Canvas canvas)
	{
		 canvas.drawBitmap(mFallAnimation.getCurBitmap(), (float)getPositionX(), (float)getPositionY(), null);
	}
	
	public void fallAni()
	{
		mCurAnimation = mFallAnimation;
	}
	public void DepoAni()
	{
		mCurAnimation = mDeposeAnimation;
	}
}
